From: Kevin Ryde Date: Mon, 16 Nov 2009 22:58:21 +0000 (+0000) Subject: * emacs-lisp/lisp-mnt.el (lm-keywords): Allow multi-line keywords. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~9435 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=27cfddb3c1f9abc413895dec3ecb7f6780cd8730;p=emacs.git * emacs-lisp/lisp-mnt.el (lm-keywords): Allow multi-line keywords. (lm-keywords-list): Allow comma-only separator like "foo,bar". Ignore trailing spaces by omit-nulls to split-string (fixing regression from Emacs 21 due to the incompatible split-string change). (Bug #4928.) --- diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index a748835d477..22d79c066c3 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -445,16 +445,20 @@ This can be found in an RCS or SCCS header." (match-string-no-properties 1))))))) (defun lm-keywords (&optional file) - "Return the keywords given in file FILE, or current buffer if FILE is nil." + "Return the keywords given in file FILE, or current buffer if FILE is nil. +The return is a `downcase'-ed string, or nil if no keywords +header. Multi-line keywords are joined up with a space between +each line." (lm-with-file file - (let ((keywords (lm-header "keywords"))) - (and keywords (downcase keywords))))) + (let ((keywords (lm-header-multiline "keywords"))) + (and keywords + (mapconcat 'downcase keywords " "))))) (defun lm-keywords-list (&optional file) "Return list of keywords given in file FILE." (let ((keywords (lm-keywords file))) (if keywords - (split-string keywords ",?[ \t]")))) + (split-string keywords "[, \t\n]+" t)))) (defvar finder-known-keywords) (defun lm-keywords-finder-p (&optional file)